Page({
  data: {
    spinShow: false,
    courseType: '',
    courseTitle: ''
  },

  onLoad: function (options) {
    const { type, title } = options;
    this.setData({
      courseType: type,
      courseTitle: title
    });
    
    // 设置页面标题
    wx.setNavigationBarTitle({
      title: `${title} - 选择题库类型`
    });
  },

  // 跳转到全量题库 (status=1)
  navigateToFullQuestionBank: function() {
    const { courseType, courseTitle } = this.data;
    wx.navigateTo({
      url: `/pages/practice/index?type=${courseType}&title=${courseTitle}&status=1`
    })
  },

  // 跳转到常备题库 (status=2)
  navigateToCommonQuestionBank: function() {
    const { courseType, courseTitle } = this.data;
    wx.navigateTo({
      url: `/pages/practice/index?type=${courseType}&title=${courseTitle}&status=2`
    })
  }
})